<?php
/**
 * [PHPFOX_HEADER]
 *
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond Benc
 * @package  		Module_Profile
 * @version 		$Id: header.html.php 4874 2012-10-10 08:26:35Z Raymond_Benc $
 */

defined('PHPFOX') or exit('NO DICE!');

?>

{if Phpfox::getService('user.privacy')->hasAccess('' . $aUser.user_id . '', 'profile.view_profile')}
	<div{if Phpfox::getService('profile')->timeline()} class="profile_timeline_header_holder"{/if}>
		<div class="profile_header{if Phpfox::getService('profile')->timeline()} profile_timeline_header{/if}{if empty($aUser.cover_photo)} no_cover_photo{/if}">

			{module name='profile.pic'}

			<div class="profile_header_inner{if Phpfox::getService('profile')->timeline()} profile_header_timeline{/if}">				                                
				<h1 style="width:400px;"><a href="{url link=$aUser.user_name}" title="{$aUser.full_name|clean}">{$aUser.full_name|clean|split:30|shorten:50:'...'}</a>{foreach from=$aBreadCrumbs key=sLink item=sCrumb name=link}{if $phpfox.iteration.link == 1}<span class="profile_breadcrumb">&#187;</span><a href="{$sLink}">{$sCrumb}</a>{/if}{/foreach}</h1>

				<div class="profile_info">
                                    <h2 class="profile_living">
					{if Phpfox::getService('user.privacy')->hasAccess('' . $aUser.user_id . '', 'profile.view_location') && (!empty($aUser.city_location) || !empty($aUser.country_child_id) || !empty($aUser.location))}
						{phrase var='profile.lives_in'} {if !empty($aUser.city_location)}{$aUser.city_location}{/if}
						{if !empty($aUser.city_location) && (!empty($aUser.country_child_id) || !empty($aUser.location))},{/if}
						{if !empty($aUser.country_child_id)}&nbsp;{$aUser.country_child_id|location_child}{/if} {if !empty($aUser.location)}{$aUser.location}{/if}
					{/if}			
                                    </h2>
					{if Phpfox::getParam('user.enable_relationship_status') && $sRelationship != ''}&middot; {$sRelationship} {/if}
                                        <ul class="profile_list_info">
                                            <li class="gender">{if $aUser.gender} Male {else} Female{/if}</li>
                                            <li class="bord">
                                                {if is_array($aUser.birthdate_display) && count($aUser.birthdate_display)}
                                                {foreach from=$aUser.birthdate_display key=sAgeType item=sBirthDisplay}
                                                    {if $aUser.dob_setting == '2'}
                                                        {phrase var='profile.age_years_old' age=$sBirthDisplay}
                                                        {else}
                                                        {phrase var='profile.born_on_birthday' birthday=$sBirthDisplay}
                                                    {/if}
                                                {/foreach}
                                                {/if}
                                            </li>
                                            <li class="relationship">{$aUser.phrase_relation}</li>
                                        </ul>
				</div>
			</div>
                        
                        <div class="profile_header_links">
                            {if $aUser.user_id == Phpfox::getUserId()}
                            <p>
                               {* <a class="profile_edit button" href="{url link='user.profile'}" >{phrase var='profile.edit_profile'}</a>*}
                                 <a class="profile_edit button" href="#" onclick="tb_show('Edit profile', $.ajaxBox('profile.editProfile', 'height=450&amp;width=560')); return false;">{phrase var='profile.edit_profile'}</a>  
                                
                            </p>
                            {elseif Phpfox::isModule('friend') && (!$aUser.is_friend || $aUser.is_friend === 3)}
                            <p>
                                <a href="#" class="profile_edit button" onclick="return $Core.addAsFriend('{$aUser.user_id}');" title="Add to Friends">Add Friends</a>
                            </p>
                            {else}
                            <p>
                                <a href="#" class="profile_edit button" onclick="$.ajaxCall('friend.delete','id={$aUser.user_id}'); $(this).text('Add Friends'); return false;" title="Friends">Friends</a>
                            </p>
                            {/if}
                            <ul class="profile_sumary">
                                <li>
                                    <span class="sumary_number">{$aUser.total_post}</span>
                                    <span class="sumary_text">Posted</span>
                                </li>
                                <li>
                                    <span class="sumary_number">{$aUser.total_topics}</span>
                                    <span class="sumary_text">Topics</span>
                                </li>
                                <li>
                                    <span class="sumary_number">{$aUser.total_albums}</span>
                                    <span class="sumary_text">Albums</span>
                                </li>
                                <li>
                                    <span class="sumary_number">25</span>
                                    <span class="sumary_text">Following</span>
                                </li>
                                <li>
                                    <span class="sumary_number">9300</span>
                                    <span class="sumary_text">Followers</span>
                                </li>
                            </ul>
                            {if isset($sStoreLink) && !empty($sStoreLink)}
                            <p>
                                <a class="button" href="{$sStoreLink}">Store</a>
                            </p>
                            {/if}
                        </div>
            </div>
	</div>

{/if}

{block location='12'}